package mk.com.ldm.corepoint.implementation.shared;

import java.util.ArrayList;
import java.util.HashMap;

import mk.com.ldm.corepoint.implementation.client.lib.generators.BaseWidget;

import com.google.gwt.user.client.ui.Widget;

public class TemporaryStorage {
	
	private static TemporaryStorage temp;
	private FormObject form = new FormObject();
	private ArrayList<Widget> widgets = new ArrayList<Widget>();
	private ArrayList<BaseWidget> reference = new ArrayList<BaseWidget>();
	
	
	public ArrayList<BaseWidget> getReference() {
		return reference;
	}

	public void setReference(ArrayList<BaseWidget> reference) {
		this.reference = reference;
	}

	private String id = new String();
	private HashMap<String,HashMap<String,BaseWidget>> groups = new HashMap<String,HashMap<String,BaseWidget>>();
	
	public ArrayList<Widget> getWidgets() {
		return widgets;
	}

	public void setWidgets(ArrayList<Widget> widgets) {
		this.widgets = widgets;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public HashMap<String, HashMap<String, BaseWidget>> getGroups() {
		return groups;
	}

	public void setGroups(HashMap<String, HashMap<String, BaseWidget>> groups) {
		this.groups = groups;
	}

	

	public static TemporaryStorage getInstance(){
		if(temp==null)
			temp = new TemporaryStorage();
		return temp;
	}

	public void setForm(FormObject form) {
		this.form = form;
	}

	public FormObject getForm() {
		return form;
	}
	
	
	
}
